#include "ros/ros.h"
#include "std_msgs/String.h"
#include <custom_msg/GPS.h>
#include <iomanip>
#include "commons/rabbit_consts.h"

void chatterCallback(const custom_msg::GPSConstPtr& msg)
{
    std::cout << std::setiosflags(std::ios::fixed) << std::setprecision(7) << "纬度：" << msg->lat <<"N or S:"<<msg->N_S<< " 经度：" << msg->lon<<"E or W:"<<msg->E_W << " groundSpeed：" << msg->groundSpeed << " speedDir：" << msg->speedDir << " gpsAngle：" << msg->gpsAngle << " gpsAngleDir：" << msg->gpsAngleDir << "\n";
}

int main(int argc, char **argv)
{
    ros::init(argc, argv, "listener");
    ros::NodeHandle n;
    ros::Subscriber sub = n.subscribe(TOPIC_GPS, 1000, chatterCallback);
    ros::spin();
    return 0;
}

